package IO.g3;

import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class OutputStream {
	
	public void byteWrite() throws IOException{
		File f = new File( "fileOutputStream.txt" );
		String s = "Ich will heim!...\n";
		byte[] buffer = s.getBytes();
		FileOutputStream out = new FileOutputStream(f);
		out.write(buffer);
		out.close();
	}

	public void characterWrite() throws IOException{
		Writer fw = null;
		fw = new FileWriter( "fileWriter.txt" );
		fw.write( "Ich will heim!..." );
		fw.append( System.getProperty("line.separator") );
		fw.close();
	}

	public static void main(String[] args) throws IOException {
		new OutputStream().byteWrite();
		new OutputStream().characterWrite(); 
	}
}
